package com.usian.quartz;

import com.usian.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class ScheduledDemo {

    @Autowired
    private UserService userService;

    @Scheduled(cron = "0/2 * * * * ?")
    public void scheduleTest(){
        //使用 Scheduled 任务调度执行一个定时任务
        userService.quartzTest();
    }
}
